<?php
// +----------------------------------------------------------------------
// | 幕小铺
// +----------------------------------------------------------------------
// | 版权所有 2016~2020 幕小铺科技（大连）有限公司
// +----------------------------------------------------------------------
// | 2020/03/14
// +----------------------------------------------------------------------
namespace app\user_center\behavior\user\sms_sending_before;

/**
 * 检测手机号码绑定(type=4 更换新手机号)
 * @package app\user_center\behavior\user\sms_sending_before
 * @author shiqiang
 */
class checkMobileBind{
    /**
     * 执行行为 run方法是Behavior唯一的接口
     * @access public
     * @return void
     */
    public function run($params){
		$uid 			= $params['uid'];
		$mobile 		= $params['mobile'];
		$mobile_type 	= $params['mobile_type'];
		if($mobile_type  == 2 || $mobile_type  == 4){
			$result = model('UcMemberMobile', 'model\user') -> getDataByMobile($mobile);
			if($result['code'] > 0){
				return array_out(-1001, '该手机号码已被使用');
			}
		}
    }
}
